const express=require('express')
const router=express.Router()



const expressJoi=require('@escook/express-joi')
const { add_article_schema,delete_article_schema,update_article_schema,get_article_schema }=require('../schema/article')

const article_handler=require('../router_handler/article')

// 发布新文章的路由
router.post('/add',expressJoi(add_article_schema),article_handler.addArtcle)
// 删除文章的路由
router.delete('/delete/:id',expressJoi(delete_article_schema),article_handler.deleteArticle)
// 修改文章的路由
router.post('/update/:id',expressJoi(update_article_schema),article_handler.updateArticle)
// 查询文章的路由
router.get('/get',article_handler.getArticle)




module.exports=router